package com.aplikata.evok.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.myfaces.custom.fileupload.UploadedFile;
import org.primefaces.model.SortOrder;
import org.primefaces.model.TreeNode;

import com.aplikata.bo.Role;
import com.aplikata.evok.bo.DoctorSchedule;
import com.aplikata.evok.bo.EvokService;
import com.aplikata.evok.bo.PatientTherapy;
import com.aplikata.evok.bo.PatientTherapyAttachment;
import com.aplikata.evok.bo.PatientTherapyComment;
import com.aplikata.evok.bo.PatientTherapyNode;
import com.aplikata.evok.bo.Therapy;
import com.aplikata.service.PublicService;

/** 
* @ClassName: EvokTherapyService 
* @Description: TODO
* @author Huyun
* @date May 30, 2012 6:19:05 PM 
*  
*/
public interface EvokTherapyService extends PublicService {

	/** 
	* @Title: getTherapyNodeTree 
	* @Description: TODO
	* @param @return
	* @return TreeNode
	* @throws 
	*/
	TreeNode getTherapyNodeTree();

	/** 
	* @Title: updateTherapy 
	* @Description: TODO
	* @param @param therapy
	* @param @return
	* @param @throws Exception
	* @return Therapy
	* @throws 
	*/
	Therapy updateTherapy(Therapy therapy) throws Exception;

	/** 
	* @Title: stopTherapy 
	* @Description: TODO
	* @param @param therapy
	* @param @return
	* @param @throws Exception
	* @return Therapy
	* @throws 
	*/
	Therapy stopTherapy(Therapy therapy) throws Exception;

	/** 
	* @Title: getTherapyNodeTree 
	* @Description: TODO
	* @param @param status
	* @param @param roleId
	* @param @param checkbox
	* @param @param forpatient
	* @param @return
	* @return TreeNode
	* @throws 
	*/
	TreeNode getTherapyNodeTree(Integer status, Long roleId);

	/** 
	* @Title: updateRoleTherapy 
	* @Description: TODO
	* @param @param role
	* @param @param selectedTherapies
	* @param @throws Exception
	* @return void
	* @throws 
	*/
	void updateRoleTherapy(Role role, TreeNode[] selectedTherapies) throws Exception;

	/** 
	* @Title: updateService 
	* @Description: TODO
	* @param @param service
	* @param @return
	* @param @throws Exception
	* @return EvokService
	* @throws 
	*/
	EvokService updateService(EvokService service) throws Exception;

	/** 
	* @Title: getTherapyTreeForDoctor 
	* @Description: TODO
	* @param @param roleId
	* @param @return
	* @return TreeNode
	* @throws 
	*/
	TreeNode getTherapyTreeForDoctor(Long roleId, PatientTherapy pt);


	/** 
	* @Title: updatePatientTherapy 
	* @Description: TODO
	* @param @param pt
	* @param @param selectedTherapyNodes
	* @param @param pnList
	* @param @return
	* @param @throws Exception
	* @return PatientTherapy
	* @throws 
	*/
	PatientTherapy updatePatientTherapy(PatientTherapy pt, DoctorSchedule schedule, TreeNode[] selectedTherapyNodes,
			List<PatientTherapyNode> pnList) throws Exception;

	/** 
	* @Title: updateTherapyAttachment 
	* @Description: TODO
	* @param @param therapyAtt
	* @param @param att
	* @param @return
	* @param @throws Exception
	* @return PatientTherapyAttachment
	* @throws 
	*/
	PatientTherapyAttachment updateTherapyAttachment(UploadedFile therapyAtt, PatientTherapyAttachment att)
			throws Exception;

	/** 
	* @Title: updateComment 
	* @Description: TODO
	* @param @param comment
	* @param @return
	* @param @throws Exception
	* @return PatientTherapyComment
	* @throws 
	*/
	PatientTherapyComment updateComment(PatientTherapyComment comment) throws Exception;

	void submitCommentReadStatus(PatientTherapy pt);
	
	/** 
	* @Title: getPatientTherapyArchive 
	* @Description: TODO
	* @param @param startDateFrom
	* @param @param startDateTo
	* @param @param first
	* @param @param pageSize
	* @param @param sortField
	* @param @param sortOrder
	* @param @param filters
	* @param @return
	* @return Object[]
	* @throws 
	*/
	Object[] getPatientTherapyArchive(Date startDateFrom, Date startDateTo, int first, int pageSize, String sortField, SortOrder sortOrder,
			Map<String, String> filters);
	
	/** 
	* @Title: getAttList 
	* @Description: TODO
	* @param @param patientTherapy
	* @param @return
	* @return List<PatientTherapyAttachment>
	* @throws 
	*/
	List<PatientTherapyAttachment> getAttList(PatientTherapy patientTherapy);
	
	/** 
	* @Title: getPriceTotal 
	* @Description: TODO
	* @param @param patientTherapy
	* @param @return
	* @return String
	* @throws 
	*/
	String getPriceTotal(PatientTherapy patientTherapy);
	
	/** 
	* @Title: getPatientTherapyNodeList 
	* @Description: TODO
	* @param @param roleId
	* @param @param patientTherapy
	* @param @return
	* @return List<PatientTherapyNode>
	* @throws 
	*/
	List<PatientTherapyNode> getPatientTherapyNodeList(Long roleId, PatientTherapy patientTherapy);

	DoctorSchedule updatePatientTherapySchedule(PatientTherapy pt, DoctorSchedule schedule,
			TreeNode[] selectedTherapyNodes, List<PatientTherapyNode> pnList) throws Exception;

}
